﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Xamarin.Forms;

namespace MasterDetailTemplate.Converters {

    /// <summary>
    /// 添加页面的触发器的转换器。
    /// By WZC
    /// </summary>
    public class MultiTriggerConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter,
            CultureInfo culture) {
            var nowdate = DateTime.Now.ToString("yyyy-MM-dd");
            var expectdate = ((DateTime) value).ToString("yyyy-MM-dd");
            if (string.Compare(expectdate, nowdate) < 0)
                return true;
            else
                return false;
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture) {
            throw new NotImplementedException();
        }
    }
}